<?php

namespace App\Http\Controllers\Wx;

use App\Http\Controllers\Controller;
use App\Models\Goods;
use EasyWeChat\Factory;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class IndexController extends Controller
{
    public function check()
    {
        $app = Factory::officialAccount(config('wechat'));
        return $app->server->serve();
    }

    public function jssdk(Request $request)
    {
        $app = Factory::officialAccount(config('wechat'));
        $APIs = ["scanQRCode",'chooseWXPay'];
        $debug = true;
        $beta = true;
        $data = $app->jssdk->buildConfig($APIs, $debug, $beta, false, [], $request->input('url'));
        return $this->response($data);
    }
}
